chore: sync upstream and clean gradle caches under $HOME - #11
Merged
Conversation
With RUN_AS_ROOT=false the runner (and this job-completed hook) runs as the runner user, whose gradle home is /home/runner/.gradle — the /root paths silently stopped matching and caches grew unbounded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…adle fix: clean gradle caches under $HOME, not hardcoded /root
Upstream f86d06f switched cleanup.sh off hardcoded /root paths so the RUN_AS_ROOT=false runner user (/home/runner) is covered too. Our cleanup.sh diverged: it persists modules-2/build-cache-*/transforms-* and LRU-caps the cache dirs instead of wiping them. Resolved by keeping our behaviour and adopting upstream's $HOME fix for the paths we do touch (daemon, journals, locks, lru_cap targets), and applied the same $HOME fix to pre-job.sh, which had the identical hardcoded paths. Our compose mounts the caches at /root/*, where $HOME is /root, so behaviour is unchanged for this deployment. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings in the two upstream commits we were behind on (
compscidr/mainup to 892b796).What upstream changed
f86d06f switched
cleanup.shoff hardcoded/rootpaths so aRUN_AS_ROOT=falserunner — whose gradle home is/home/runner/.gradle— is actually covered. The/rootglobs had silently stopped matching there and caches grew unbounded.Conflict resolution
cleanup.shconflicted: our fork rewrote it to persistmodules-2/build-cache-*/transforms-*and LRU-cap the cache dirs, while upstream still deletes build-cache and transforms after every job.Resolved by keeping our behaviour and adopting upstream's
$HOMEfix only for the paths we do touch — the daemon dir, journals, lock files, and thelru_captargets. The same fix is applied topre-job.sh, which carried the identical hardcoded/rootpaths and which upstream never touched.Impact here
None for this deployment:
docker-compose.ymlmounts the caches at/root/*and those containers run as root, so$HOMEis/root. The change only makes the hooks correct if a runner is ever started withRUN_AS_ROOT=false.Both scripts pass
bash -n.🤖 Generated with Claude Code